package com.carryGo.utils;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016092400584640";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCDKOG9DkY5JPry8Hl+K+lNDH7xp8E2rnrRbA2E5ZFk+jgml4iP/GZJnDXKDEHpc92Y+lAGO8iAYh5fykbfviSSxmpyCSzkQhIytDX2FbZlkFW6Y68Kz76z7CrFRb4En9jT0H2waDz0g28SEB1Wh01ZIbKDCPlMiQz/scQPcyH0SczzOsV4YKFFOxw9HYqm0jjEhrnYK9u9Oh4GvRndqoUn0IQxWLXYLlMVF4OBv9DoJxZKZWalfq2ldKQTwNPgIV2TennoCCB8AVETxsHtg6YRxiucNY+S34B2QLPbyCTmh5hiCeVNO8Yq15icyFGUfdHhlA7a64LixWcYG4JWF0/9AgMBAAECggEAfHWVyB28e0thKpkQ4K5wg2GhMFUcnnPxLbrYFUz2rBhYoh5XQzKiKaWm0STSguIk3J5iw5eFSnZRFlrO6E/5SqInrjCQvcUImb6yGeM+op/VCbrABoVeFEO9zlbA2oiIa27DZltzxB7Yjg5mmI5p0nOMfpVMY9kFUblxL6v0A2eFgbZruQW+Vrylh/LX6CvZ1OAGmq5LH7dcL6DU21H9ArNBZoAy6Uz+zvobmmSHfy8OAvBu9RxNhAwk2HThaJniloPm7phlJhoDAAXsNgb5kgng/R5aNVi3VZ6XZJfOExUnyWi4EbuJQhDwjosySmZnT3HLCbfHxBsLvZvtyPWczQKBgQDhHK9g4amr1uQlaCB7sx2IoCTFCowdCdfi0nLBCghOjzmvfMQPHm4doRWHqB+dCqqnnkFeyrcvY9or7F4By0Ld7kKAv7knzzofvz9BpCu8nT6kMWnMmXNNEpCBIrXDBaJl8ZfXJ1eY2N1i2y8GfLoDRIPI6hgJwEad8j+wQaLnIwKBgQCVKAOd/cPK3EhmIphUIi+fafKbhrBuCcY8zj0U6IAwbT3T9hidpY02nkSWCxSnfXqqYL/n54Ku/4PAPDEdWXTvSn9gPpgB0MnW1EOccYYNF27rp0+bbKOkkhwzx7WOl5q/MRyBKSQOgYBZ7QEHhsq0ESPGbjgR34uomrkPNcvuXwKBgQDMfvF20ij/WLxyms//b2xh5BDjCrzT2FBM1h627DU1oHinyXCVx3AC7IWRcZIeaEU09deuk/qrS0szYYrYmFyLHVk+emxqFJ9ZnbOKHug4dKQmJllVKwUKO9YX6X8yxdiMQVdNdYjm6gLbPf/PJdkZBNGu37GskgXUj+95X3br/wKBgCFZUf24KFeqCvHzGDXvctBkwt6tLbNcshsUTanoFgk9044ZvwU4Z6tnlZQqpBKSxqNjgGTcaWaxMIcBrkWOo8uAz5v4QspdIVPMH9XRuBQjQiSkQvNQRgJcvLuDEn/wO6Q12dazGSG5KLZyfEFvjNDX6DTMnfK5FaO7/FZ/Q7pnAoGBANUSaehG92Ge0F5YpbPMhO0siPaseX0Rt/nnzzn21A085M8OOMagts8KjdJoNTfx1r+fwFfENBV4Jq6FvAq3Un6PA36CCASnPbbB/fM46GwGUYCfhQzTEiOrJisVo4uSekCpv+S4pA8Cr1gB1SRBXHnBx3SCVqVy/OC4NyEMeIBT";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2WvGrZL/UUUZTdesf6E/G0oEa7BmTFVdIld6fCiKviDV4Ayfr3U1Rw1W4q00wzjJ8FuW7rKdSuxcKkI+4VfuPFL1yOA5wCmmjn9WxCaDkEmTYGgyH6ra9JRx8/6laeAWDWTvQgbUkCiZ3FxJPnZk0F4RxdJwjwYCiW55BJBQMZpIIrRqCyTPeRuMcMtHoAhfgbL/FKIG4a0nHphxNMfSo+YrxS6pVjWUHZ30Hr19IlrLoWvcROdqEkcK8Ve8qgsk4qOu8kZKqgD03WWNGYCWJEGmN5UZ3L2X22oJHM7qtsZTkXFOhKCWj+r4d6bTwVNhDeQwyQ6o83EbCv6hJPWFLwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/20200828_alipay_war_exploded/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/20200828_alipay_war_exploded/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "D:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

